package com.sz.youban.manage.common;

import javax.annotation.PostConstruct;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.sz.youban.dt.interfs.allinpay.IDtPayInvokeRecordsService;

/**
 * @author ruichar
 * 交易结果回调app，定时任务处理
 */
@Component
public class PayInvokeJob implements Job
{
	private Logger logger = LoggerFactory.getLogger(PayInvokeJob.class);
	@Autowired
	private IDtPayInvokeRecordsService payInvokeRecordsService;

	private static PayInvokeJob job;

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException
	{
		logger.info("===============start PayInvokeJob===");
		try
		{
			job.payInvokeRecordsService.scanPayNotify();
		}
		catch (Exception e) 
		{
			logger.error("{}",e);
		}
		
		logger.info("===============end PayInvokeJob===");
	}

	@PostConstruct
	public void init()
	{
		job = this;
	}
	
}
